<template>
  <div class="father">
    <h3>父组件{{ a }}</h3>
    <button @click="abc">点击我</button>
    <Child :a="a" :b="b" :updateA="updateA" />
  </div>
</template>

<script setup lang="ts" name="Father">
import Child from "./Child.vue";
import { ref } from "vue";

let a = ref(1);
let b = ref(2);

function updateA(value: number) {
  a.value += value;
}

function abc() {
  a.value = a.value + 1;
}
</script>

<style scoped>
.father {
  background-color: rgb(165, 164, 164);
  padding: 20px;
  border-radius: 10px;
}
</style>
